<template>
    <div class="top-element">
      <div v-for="(item,index) in datasource" :class={'currentElement':currentKey==item.key} @click="switch(item,index)">
  {{item.key}}
    </div>
    </div>
  </template>
  <script>
  data(){
    return {
    currentKey:"",
    datasource:[{key:'1'},{key:'2'}]
    }
  },
  methods:{
    switch(item,index){
    this.datasource[index].flag=! this.datasource[index].flag;
    }
  }
  </script>
  <style lang="scss">
  .currentElement{
    color:blue;
  }
  </style>